#include "MainScene.h"
#include "MainMenuLayer.h"
#include "CCAdView.h"

MainScene::MainScene()
{
}

MainScene::~MainScene()
{
}

bool MainScene::init()
{
  do
  {
    CC_BREAK_IF(!CCScene::init());

    MainMenuLayer * pMenuLayer = MainMenuLayer::create();
    CC_BREAK_IF(!pMenuLayer);
    addChild(pMenuLayer);

    CCAdView* pAdView = CCAdView::create(kCCAdSizeBanner, "a152d4e25c49528");
    this->addChild(pAdView);
    pAdView->useLocation(kCCLocationFine);
    pAdView->setAlignment(kCCHorizontalAlignmentCenter, kCCVerticalAlignmentBottom);
    pAdView->loadAd();
    return true;
  }
  while(0);
  return false;
}

MainScene * MainScene::create()
{
  MainScene * pScene = new MainScene();
  if (pScene && pScene->init())
  {
    pScene->autorelease();
    return pScene;
  }
  else
  {
    CC_SAFE_DELETE(pScene);
    return NULL;
  }
}
